home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / zap-to-it.swf / scripts / frame_16 / PlaceObject2_842_288 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2005-09-29  |  10.2 KB  |  225 lines

  1. onClipEvent(enterFrame){
  2.    if(!pause)
  3.    {
  4.       if(eval("variables:arrowCounter") < eval("variables:arrowAmount"))
  5.       {
  6.          if(eval("variables:arrowCurrentSpace") >= eval("variables:arrowSpacer"))
  7.          {
  8.             duplicateMovieClip(_parent.arrow,"arrow" + eval("variables:arrowCounter"),16384 + eval("variables:arrowCounter"));
  9.             eval("_parent.arrow" + eval("variables:arrowCounter")).orientation = 1;
  10.             eval("_parent.arrow" + eval("variables:arrowCounter")).success = false;
  11.             frame = random(eval("variables:arrowPossibilities") + 1);
  12.             eval("_parent.arrow" + eval("variables:arrowCounter")).gotoAndStop(frame);
  13.             ┬ºvariables:arrowCounter┬º++;
  14.             set("variables:arrowCurrentSpace",0);
  15.          }
  16.          else
  17.          {
  18.             set("variables:arrowCurrentSpace",eval("variables:arrowCurrentSpace") + eval("variables:arrowSpeed"));
  19.          }
  20.       }
  21.       i = eval("variables:currentLeadArrow");
  22.       while(i < eval("variables:arrowCounter"))
  23.       {
  24.          arrowPointer = eval("_parent.arrow" + i);
  25.          arrowPointer._x += eval("variables:arrowSpeed");
  26.          if(arrowPointer._x >= eval("variables:endOfRun") - 60 && arrowPointer._x < eval("variables:endOfRun") && arrowPointer)
  27.          {
  28.             arrowPointer.arrow.play();
  29.             if(arrowPointer.orientation == 1 && eval("keyboard_listener:up") && !eval("keyboard_listener:down") && !eval("keyboard_listener:left") && !eval("keyboard_listener:right") && !arrowPointer.success)
  30.             {
  31.                arrowPointer.success = true;
  32.                if(eval("variables:currentLeadArrow") == eval("variables:arrowAmount") - 1)
  33.                {
  34.                   trace("CAST");
  35.                   removeMovieClip(arrowPointer);
  36.                   _parent.player.character.gotoAndPlay("cast");
  37.                   pause = true;
  38.                }
  39.                else
  40.                {
  41.                   _parent.grim.gotoAndPlay("success");
  42.                   colorChanger.play();
  43.                   _parent.player.character.gotoAndPlay("up");
  44.                }
  45.             }
  46.             else if(arrowPointer.orientation == 2 && !eval("keyboard_listener:up") && !eval("keyboard_listener:down") && !eval("keyboard_listener:left") && eval("keyboard_listener:right") && !arrowPointer.success)
  47.             {
  48.                arrowPointer.success = true;
  49.                if(eval("variables:currentLeadArrow") == eval("variables:arrowAmount") - 1)
  50.                {
  51.                   trace("CAST");
  52.                   removeMovieClip(arrowPointer);
  53.                   _parent.player.character.gotoAndPlay("cast");
  54.                   pause = true;
  55.                }
  56.                else
  57.                {
  58.                   _parent.grim.gotoAndPlay("success");
  59.                   colorChanger.play();
  60.                   _parent.player.character.gotoAndPlay("right");
  61.                }
  62.             }
  63.             else if(arrowPointer.orientation == 3 && !eval("keyboard_listener:up") && eval("keyboard_listener:down") && !eval("keyboard_listener:left") && !eval("keyboard_listener:right") && !arrowPointer.success)
  64.             {
  65.                arrowPointer.success = true;
  66.                if(eval("variables:currentLeadArrow") == eval("variables:arrowAmount") - 1)
  67.                {
  68.                   trace("CAST");
  69.                   removeMovieClip(arrowPointer);
  70.                   _parent.player.character.gotoAndPlay("cast");
  71.                   pause = true;
  72.                }
  73.                else
  74.                {
  75.                   _parent.grim.gotoAndPlay("success");
  76.                   colorChanger.play();
  77.                   _parent.player.character.gotoAndPlay("down");
  78.                }
  79.             }
  80.             else if(arrowPointer.orientation == 4 && !eval("keyboard_listener:up") && !eval("keyboard_listener:down") && eval("keyboard_listener:left") && !eval("keyboard_listener:right") && !arrowPointer.success)
  81.             {
  82.                arrowPointer.success = true;
  83.                if(eval("variables:currentLeadArrow") == eval("variables:arrowAmount") - 1)
  84.                {
  85.                   trace("CAST");
  86.                   removeMovieClip(arrowPointer);
  87.                   _parent.player.character.gotoAndPlay("cast");
  88.                   pause = true;
  89.                }
  90.                else
  91.                {
  92.                   _parent.grim.gotoAndPlay("success");
  93.                   colorChanger.play();
  94.                   _parent.player.character.gotoAndPlay("left");
  95.                }
  96.             }
  97.             else if(arrowPointer.orientation == 5 && eval("keyboard_listener:up") && !eval("keyboard_listener:down") && !eval("keyboard_listener:left") && eval("keyboard_listener:right") && !arrowPointer.success)
  98.             {
  99.                arrowPointer.success = true;
  100.                if(eval("variables:currentLeadArrow") == eval("variables:arrowAmount") - 1)
  101.                {
  102.                   trace("CAST");
  103.                   removeMovieClip(arrowPointer);
  104.                   _parent.player.character.gotoAndPlay("cast");
  105.                   pause = true;
  106.                }
  107.                else
  108.                {
  109.                   _parent.grim.gotoAndPlay("success");
  110.                   colorChanger.play();
  111.                   _parent.player.character.gotoAndPlay("up-right");
  112.                }
  113.             }
  114.             else if(arrowPointer.orientation == 6 && eval("keyboard_listener:up") && eval("keyboard_listener:down") && !eval("keyboard_listener:left") && !eval("keyboard_listener:right") && !arrowPointer.success)
  115.             {
  116.                arrowPointer.success = true;
  117.                if(eval("variables:currentLeadArrow") == eval("variables:arrowAmount") - 1)
  118.                {
  119.                   trace("CAST");
  120.                   removeMovieClip(arrowPointer);
  121.                   _parent.player.character.gotoAndPlay("cast");
  122.                   pause = true;
  123.                }
  124.                else
  125.                {
  126.                   _parent.grim.gotoAndPlay("success");
  127.                   colorChanger.play();
  128.                   _parent.player.character.gotoAndPlay("up-down");
  129.                }
  130.             }
  131.             else if(arrowPointer.orientation == 7 && eval("keyboard_listener:up") && !eval("keyboard_listener:down") && eval("keyboard_listener:left") && !eval("keyboard_listener:right") && !arrowPointer.success)
  132.             {
  133.                arrowPointer.success = true;
  134.                if(eval("variables:currentLeadArrow") == eval("variables:arrowAmount") - 1)
  135.                {
  136.                   trace("CAST");
  137.                   removeMovieClip(arrowPointer);
  138.                   _parent.player.character.gotoAndPlay("cast");
  139.                   pause = true;
  140.                }
  141.                else
  142.                {
  143.                   _parent.grim.gotoAndPlay("success");
  144.                   colorChanger.play();
  145.                   _parent.player.character.gotoAndPlay("up-left");
  146.                }
  147.             }
  148.             else if(arrowPointer.orientation == 8 && !eval("keyboard_listener:up") && eval("keyboard_listener:down") && !eval("keyboard_listener:left") && eval("keyboard_listener:right") && !arrowPointer.success)
  149.             {
  150.                arrowPointer.success = true;
  151.                if(eval("variables:currentLeadArrow") == eval("variables:arrowAmount") - 1)
  152.                {
  153.                   trace("CAST");
  154.                   removeMovieClip(arrowPointer);
  155.                   _parent.player.character.gotoAndPlay("cast");
  156.                   pause = true;
  157.                }
  158.                else
  159.                {
  160.                   _parent.grim.gotoAndPlay("success");
  161.                   colorChanger.play();
  162.                   _parent.player.character.gotoAndPlay("right-down");
  163.                }
  164.             }
  165.             else if(arrowPointer.orientation == 9 && !eval("keyboard_listener:up") && !eval("keyboard_listener:down") && eval("keyboard_listener:left") && eval("keyboard_listener:right") && !arrowPointer.success)
  166.             {
  167.                arrowPointer.success = true;
  168.                if(eval("variables:currentLeadArrow") == eval("variables:arrowAmount") - 1)
  169.                {
  170.                   trace("CAST");
  171.                   removeMovieClip(arrowPointer);
  172.                   _parent.player.character.gotoAndPlay("cast");
  173.                   pause = true;
  174.                }
  175.                else
  176.                {
  177.                   _parent.grim.gotoAndPlay("success");
  178.                   colorChanger.play();
  179.                   _parent.player.character.gotoAndPlay("right-left");
  180.                }
  181.             }
  182.             else if(arrowPointer.orientation == 10 && !eval("keyboard_listener:up") && eval("keyboard_listener:down") && eval("keyboard_listener:left") && !eval("keyboard_listener:right") && !arrowPointer.success)
  183.             {
  184.                arrowPointer.success = true;
  185.                if(eval("variables:currentLeadArrow") == eval("variables:arrowAmount") - 1)
  186.                {
  187.                   trace("CAST");
  188.                   removeMovieClip(arrowPointer);
  189.                   _parent.player.character.gotoAndPlay("cast");
  190.                   pause = true;
  191.                }
  192.                else
  193.                {
  194.                   _parent.grim.gotoAndPlay("success");
  195.                   colorChanger.play();
  196.                   _parent.player.character.gotoAndPlay("left-down");
  197.                }
  198.             }
  199.          }
  200.          if(arrowPointer._x >= eval("variables:endOfRun") && arrowPointer)
  201.          {
  202.             if(!arrowPointer.success)
  203.             {
  204.                if(eval("variables:currentLeadArrow") == eval("variables:arrowAmount") - 1 && _parent.lifebar._currentframe != 3)
  205.                {
  206.                   trace("CAST");
  207.                   removeMovieClip(arrowPointer);
  208.                   _parent.player.character.gotoAndPlay("cast");
  209.                   pause = true;
  210.                }
  211.                else
  212.                {
  213.                   _parent.lifebar.play();
  214.                   goodWrong.gotoAndPlay("wrong");
  215.                   _parent.grim.gotoAndPlay("failure");
  216.                }
  217.             }
  218.             ┬ºvariables:currentLeadArrow┬º++;
  219.             removeMovieClip(arrowPointer);
  220.          }
  221.          i++;
  222.       }
  223.    }
  224. }
  225.